using UnityEngine;

public class Obejct_BlackSmith : Object_NPC
{
    private Inventory_Storage playerStorage;

    private Inventory_Player playerInventory;

    protected override void Awake()
    {
        base.Awake();
        npcAnim.SetBool("IsBlackSmith", true);
        playerStorage = GetComponent<Inventory_Storage>();

    }
    //交互
    public override void Interact()
    {
        base.Interact();
        uI.storageUI.SetupStorageUI(playerStorage);
        uI.craftUI.SetupCraftUI(playerStorage);
        // uI.OpenCraftAndStorageUI(true);
        uI.OpenDialogueUI(dialogueLine, new DialogueNPCData(rewardNPC, questDatas));
    }

    protected override void OnTriggerEnter2D(Collider2D collision)
    {
        base.OnTriggerEnter2D(collision);

        if (player == null) return;
        
        playerInventory = player.GetComponent<Inventory_Player>();

        playerStorage.SetPlayerInventory(playerInventory);
    }
    protected override void OnTriggerExit2D(Collider2D collision)
    {
        base.OnTriggerExit2D(collision);

        uI.OpenCraftAndStorageUI(false);
    }
    public override void SaveData(ref GameData gameData)
    {
        base.SaveData(ref gameData);
    }
    public override void LoadData(GameData gameData)
    {
        base.LoadData(gameData);
    }
}
